export default (input: any, search: any) => {
  let isComposing = false;
  input.addEventListener("input", ({ target: { value } }: any) => {
    if (isComposing) return;
    search(value);
  });
  input.addEventListener("compositionstart", () => {
    isComposing = true;
    console.log("中文输入开始");
  });
  input.addEventListener("compositionend", ({ target: { value } }: any) => {
    isComposing = false;
    console.log("中文输入结束");
    search(value);
  });
};
